def add_method_to(a_class)
  a_class.class_eval do
    def m; "Hello!"; end
  end
end

add_method_to(String)
p "adc".m

MyClass = Class.new(Array) do
  def my_method
    "Hello!!"
  end
end

p MyClass.new.my_method